package com.bdqn.xu.dao.iml;

import com.bdqn.xu.dao.BaseDaoImpl;
import com.bdqn.xu.dao.InvitationDao;
import com.bdqn.xu.pojo.Invitation;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("invi")
public class InvitationDaoImpl extends BaseDaoImpl<Invitation> implements InvitationDao {

    @Override
    public Invitation getInvitationByid(){
        return findById(1);
    }
    @Override
    public List<Invitation> getList(){
        return findAll();
    };

    @Override
    public List<Invitation> likelist(String title){
        StringBuilder hql =new StringBuilder("select * from invitation  where title like ?0") ;
        List<Invitation> list =(List<Invitation>)  getCurrentSession().createQuery(hql.toString()).setParameter(0,"%"+title+"%");
        return list;
    }
    @Override
    public void delReply(Integer id){
        super.deleteById(id);
    }


}
